<html>
<head><meta charset="utf-8"><title>duplication between move &amp; copy · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html">duplication between move &amp; copy</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167921104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921104">(Jun 12 2019 at 07:02)</a>:</h4>
<p>Apropos <code>Operand::Copy</code> and <code>Operand::Move</code>do you think it would be error-prone to have <code>Operand::Move</code> and <code>Operand::Copy</code> be one <code>Operand::Consume</code> again and adding a second field for differentiating?</p>



<a name="167921117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921117">(Jun 12 2019 at 07:02)</a>:</h4>
<p>likely yeah</p>



<a name="167921135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921135">(Jun 12 2019 at 07:03)</a>:</h4>
<p>so, how do you like an <code>Operand::consume</code> method returning an <code>Option&lt;Place&gt;</code>?</p>



<a name="167921141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921141">(Jun 12 2019 at 07:03)</a>:</h4>
<p>nope</p>



<a name="167921148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921148">(Jun 12 2019 at 07:03)</a>:</h4>
<p>for all the code that matches on <code>Operand::Move</code> and <code>Operand::Copy</code></p>



<a name="167921149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921149">(Jun 12 2019 at 07:03)</a>:</h4>
<p>anything that doesn't care is likely visiting through operands anyway</p>



<a name="167921154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921154">(Jun 12 2019 at 07:03)</a>:</h4>
<p>there's loads of duplication</p>



<a name="167921213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921213">(Jun 12 2019 at 07:04)</a>:</h4>
<p>well... unfortunately the "likely" is not true. We have quite a few of such matches</p>



<a name="167921244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921244">(Jun 12 2019 at 07:04)</a>:</h4>
<p>I guess it depends on the kind of code. but I would expect at least some of them to start treating copies and moves differently</p>



<a name="167921269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921269">(Jun 12 2019 at 07:05)</a>:</h4>
<p>just grep for <code>Operand::Copy</code> in <a href="https://github.com/rust-lang/rust/pull/60913/files" target="_blank" title="https://github.com/rust-lang/rust/pull/60913/files">https://github.com/rust-lang/rust/pull/60913/files</a></p>



<a name="167921322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921322">(Jun 12 2019 at 07:06)</a>:</h4>
<p><em>sigh</em> why am I not pinged on that PR?</p>



<a name="167921825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921825">(Jun 12 2019 at 07:14)</a>:</h4>
<p>because it's nowhere ready</p>



<a name="167921828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921828">(Jun 12 2019 at 07:14)</a>:</h4>
<p>we're using it as a canary for smaller PRs</p>



<a name="167921841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921841">(Jun 12 2019 at 07:14)</a>:</h4>
<p>yeah but I'd like to know when each of those PRs goes up :P</p>



<a name="167921857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921857">(Jun 12 2019 at 07:15)</a>:</h4>
<p>to hype myself up about them if nothing else!</p>



<a name="167921935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/duplication%20between%20move%20%26%20copy/near/167921935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/duplication.20between.20move.20.26.20copy.html#167921935">(Jun 12 2019 at 07:16)</a>:</h4>
<p>kk</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>